package chain_of_responsibility;

/**
 * @Author: linKe
 * @Date: 2022/1/14 22:59
 * @FileName: SensitiveFilter
 * @version: 1.0
 * @Description: 敏感字过滤器
 */
public class SensitiveFilter implements Filter{
    @Override
    public void doFilter(Request request, Response response, FilterChain chain) {
        request.setRequestStr(request.getRequestStr().replaceAll("敏感", "和谐"));
        chain.doFilter(request, response, chain);
        response.setResponseStr(response.getResponseStr() + "\r\n---SensitiveFilter");
    }
}
